<?php
namespace App\Lib;

class Code extends AbstractCode {
    const NOTAUTH                       = 403;              //暂无权限
	const NOTFOUND					    = 404;				//资源不存在
	const SUCCESS						= 0;				//成功
    const SYSERROR                      = 500;              //内部错误

    const RECHARGE_THIRD_LOG            = 10001;            //充值第三方错误代码
    const RECHARGE_MCH_LOG              = 10002;            //充值商户错误代码

    const JWT_INVALID                   = 20001;            //jwt token无效
    const JWT_EXPIRED                   = 20002;            //jwt token失效
    const JWT_ERROR                     = 20003;            //jwt token生成失败
    const SMS_EMPTY                     = 20004;            //sms 短信验证码为空
    const SMS_INVALID                   = 20005;            //sms 短信验证码无效

    const LOGIN_INVALID                 = 30001;            //用户名或密码错误
    const REGISTER_USER_EXISTS          = 30002;            //账户名已存在或手机号已被注册
    const REGISTER_TOKEN_INVALID        = 30003;            //注册token无效
    const LOGIN_PWD_INVALID             = 30004;            //登录密码错误
    const TRADE_PWD_INVALID             = 30005;            //交易密码错误
    const BALANCE_INSUFFICIENT          = 30006;            //余额不足
    const WITHDRAW_DISABLE              = 30007;            //余额不足提现条件
    const WITHDRAW_TOO_LOW              = 30000;            //低于最低单笔出款条件
    const UNBIND_BANK                   = 30008;            //未绑定有效结算信息
    const WITHDRAW_TOO_HIGH             = 30009;            //高于最大单笔出款条件

    const FATAL_ERROR					= 40000;			//致命错误
    const SIGN_ERROR 					= 40001;			//参数sign错误
    const HTTP_REQUEST_METHOD_ERROR		= 40002;			//请求method错误
    const HTTP_REQUEST_PARAM_ERROR		= 40003;			//请求参数错误
    const PROFILE_INFO_UNCOMPLETE       = 40005;            //用户基本信息未完善
    const REMIT_INFO_UNCOMPLETE         = 40006;            //用户结算信息未完善
    const TOPAY_ID_INVALID              = 40007;            //结算id不正确

    //login
    const USER_PHONE_NOT_MATCH          = 50000;            //用户名和电话号码不匹配
    const REGISTER_PHONE_EXISTS         = 50001;            //该手机号已被注册



	public static function errMsg() {
		return array(
		    self::NOTAUTH                       =>  '无权限操作创建或更新',
			self::NOTFOUND						=>	'资源不存在',
			self::SUCCESS						=>	'success',
			self::FATAL_ERROR					=>	'接口错误,请联系管理员',
			self::SIGN_ERROR 					=>	'签名错误',
			self::HTTP_REQUEST_METHOD_ERROR		=>	'api请求方式错误',
			self::HTTP_REQUEST_PARAM_ERROR		=>	'api请求参数错误',
            self::SYSERROR                      =>  '内部错误',
            self::PROFILE_INFO_UNCOMPLETE       =>  '用户基本信息未完善',
            self::REMIT_INFO_UNCOMPLETE         =>  '用户结算信息未完善',
            self::TOPAY_ID_INVALID              =>  '结算id不正确',

            self::JWT_INVALID                   => 'token无效',
            self::JWT_EXPIRED                   => 'token失效',
            self::JWT_ERROR                     => 'token生成失败',
            self::SMS_EMPTY                     => 'sms短信验证码为空',
            self::SMS_INVALID                   => 'sms短信验证码无效',

            self::LOGIN_INVALID                 => '用户名或密码错误',
            self::REGISTER_USER_EXISTS          => '账户名已存在或手机号已被注册',
            self::REGISTER_TOKEN_INVALID        => '注册token无效',
            self::LOGIN_PWD_INVALID             => '登录密码错误',
            self::TRADE_PWD_INVALID             => '交易密码错误',
            self::BALANCE_INSUFFICIENT          => '余额不足',
            self::WITHDRAW_DISABLE              => '余额不满足提交金额条件',
            self::UNBIND_BANK                   => '未绑定有效结算信息',
            self::WITHDRAW_TOO_LOW              => '低于最低单笔出款条件',
            self::WITHDRAW_TOO_HIGH             => '高于最大单笔出款条件',


            self::USER_PHONE_NOT_MATCH          => '用户名和电话号码不匹配',
            self::REGISTER_PHONE_EXISTS         => '该手机号已被注册'
		);
	}
	

}
